package com.captainbank.tcl.tclapplication.ui.activity.test;

import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.captainbank.tcl.tclapplication.R;
import com.captainbank.tcl.tclapplication.ui.activity.basic.BaseActivity;
import com.captainbank.tcl.tclapplication.utils.MyToast;
import com.captainbank.tcl.tclapplication.utils.StringUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by TCL on 2019/9/6.
 * Describe:
 */
public class TempTest2Activity extends BaseActivity {
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.et_id)
    EditText etId;
    @BindView(R.id.btn)
    Button btn;
    @BindView(R.id.tv_link)
    TextView tvLink;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_temp_test2;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        toolbar.setTitle(getString(R.string.title_temp_test));

        btn.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                etId.setText("");
                return true;
            }
        });
    }

    @OnClick(R.id.btn)
    public void onViewClicked() {
        String id = etId.getText().toString().trim();
        if(StringUtil.checkIsNotNull(id)){
            String link = "http://huodong.m.taobao.com/act/talent/tblive.html?userId=" + id;
            tvLink.setText(link);
        }else{
            MyToast.toastNormal(this,"请输入id");
        }
    }

}
